<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    <title>随手记 | 不积跬步无以至千里</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#1c9d5c">
    
    
    <meta name="keywords" content="keywords">
    <meta name="description" content="desc">
<meta name="keywords" content="keywords">
<meta property="og:type" content="website">
<meta property="og:title" content="随手记">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="随手记">
<meta property="og:description" content="desc">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="随手记">
<meta name="twitter:description" content="desc">
    
        <link rel="alternate" type="application/atom+xml" title="随手记" href="/atom.xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/css/style.css?v=1.7.2">
    <script>window.lazyScripts=[]</script>

    <!-- custom head -->
    

</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu"  >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap" style="background-image:url(/img/brand.jpg)">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">马建</h5>
          <a href="mailto:markjoker@126.com" title="markjoker@126.com" class="mail">markjoker@126.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect active">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                归档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/categories"  >
                <i class="icon icon-lg icon-th-list"></i>
                分类
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="https://github.com/markjoker" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://www.weibo.com/markjoker" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                微博
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/cv"  >
                <i class="icon icon-lg icon-file"></i>
                简历
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">随手记</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header index-header">

    <div class="container fade-scale">
        <h1 class="title">随手记</h1>
        <h5 class="subtitle">
            
                不积跬步无以至千里
            
        </h5>
    </div>

    


</header>

<div class="container body-wrap">

    <ul class="post-list">
    
        <li class="post-list-item fade">
            <article id="post-acp"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2019-09-12 19:12:10" datetime="2019-09-12T11:12:10.000Z"  itemprop="datePublished">2019-09-12</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2019/09/12/acp/">阿里ACP云计算题库</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        单选题 1. 阿里云的云盾会检查通过公共互联网登录云服务器ECS的来源IP，登录方式包括SSH和远程桌面，当来自某个IP的登录请求出现多次密码错误的情况时，会发出”ECS遭遇密码暴力破解”的报警，当收到这个报警后，最安全的处理方法应该是____。

A.通知自己业务平台的所有用户立即修改密码，并通过技术手段杜绝简单密码
B.这个报警无关紧要，可以忽略
C.立即更新云服务器ECS实例的系统用户...
    

        <a href="/2019/09/12/acp/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/730/">730</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/ACP/">ACP</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/ACP在线题库/">ACP在线题库</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/云计算/">云计算</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/在线题库/">在线题库</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/阿里/">阿里</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-react-native-https"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2018-03-28 15:43:22" datetime="2018-03-28T07:43:22.000Z"  itemprop="datePublished">2018-03-28</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2018/03/28/react-native-https/">React Native 自签名Https处理</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        问题描述现在绝大多数网站已转为https方式浏览，但很多情况下https的证书并不是CA颁发的合法证书，而是通过公司或个人自签名产生的证书。当我们在开发移动应用时，对于这种自签名证书，通常是需要额外的通过证书来校验访问的合法性。当我们再开发React Native应用时，由于框架封装了网络请求库，造成我们无法自定义相关逻辑。本文的主要目的就是记录一下再开发过程中遇到此类问题是怎么解决的。
I...
    

        <a href="/2018/03/28/react-native-https/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/React-Native/">React Native</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-architecture-paging"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-10-12 17:23:07" datetime="2017-10-12T09:23:07.000Z"  itemprop="datePublished">2017-10-12</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/10/12/architecture-paging/">Android架构组件(8)-Paging</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        分页库使您的应用程序能够更轻松地根据需要从数据源加载信息，而不会使设备过载或等待太长的数据库查询时间。
概览
许多应用程序可以处理大量数据，但只需要随时加载和显示一小部分数据。 一个应用程序可能有数千个可能显示的项目，但它可能只需要一次访问几十个项目。 如果应用程序不小心，它最终可能会请求实际不需要的数据，从而给设备和网络带来性能负担。 如果数据与远程数据库存储或同步，则这也会降低应用速度并...
    

        <a href="/2017/10/12/architecture-paging/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android/">Android</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Architecture-Components/">Architecture Components</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-architecture-room"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-10-11 15:41:10" datetime="2017-10-11T07:41:10.000Z"  itemprop="datePublished">2017-10-11</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/10/11/architecture-room/">Android架构组件(七)-Room</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        利用Room保存数据到本地数据库
Room提供了一个SQLite的抽象层，可以在充分利用SQLite的同时访问流畅的数据库。
数据的本地持久化对某些需要处理大量结构化数据的App非常有益。最常见的用例是缓存相关的数据。这样，当设备无法访问网络时，用户仍然可以在脱机状态下浏览该内容。设备重新联机后，任何用户造成的内容更改都会同步到服务器。
由于Room会为您处理这些问题，我们强烈建议使用Roo...
    

        <a href="/2017/10/11/architecture-room/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android/">Android</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Architecture-Components/">Architecture Components</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-architecture-saving-states"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-28 19:33:31" datetime="2017-09-28T11:33:31.000Z"  itemprop="datePublished">2017-09-28</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/28/architecture-saving-states/">Android架构组件(六)-保存状态</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        保持UI状态是用户体验的关键部分。无论用户是旋转设备，或者用户重新启动应用程序，还是系统关闭应用程序，重要的是你的activity保持用户期望的状态。
如果要保存的UI数据是简单和轻量级的，那么您可以使用onSaveInstanceState()来保存您的状态数据。在需要保存复杂数据的情况下，可以组合地使用ViewModel对象、onSaveInstanceState()方法以及持久本地存储...
    

        <a href="/2017/09/28/architecture-saving-states/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android/">Android</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Architecture-Components/">Architecture Components</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-architecture-viewmodel"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-25 20:22:31" datetime="2017-09-25T12:22:31.000Z"  itemprop="datePublished">2017-09-25</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/25/architecture-viewmodel/">Android架构组件(五)-ViewModel</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        ViewModel类被设计用来以 lifecycle 的方式存储和管理与ui相关的数据，ViewModel类允许数据在诸如屏幕旋转之类的配置更改中存活。
Android 框架管理 UI 控制器的生命周期，比如 activities 和 fragments。该框架可能会决定销毁或重新创建UI控制器，以响应完全超出您控制的某些用户操作或设备事件。
如果系统销毁或重新创建一个UI控制器，那么存储在...
    

        <a href="/2017/09/25/architecture-viewmodel/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android/">Android</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Architecture-Components/">Architecture Components</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/ViewModel/">ViewModel</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-architecture-livedata"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-21 19:44:55" datetime="2017-09-21T11:44:55.000Z"  itemprop="datePublished">2017-09-21</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/21/architecture-livedata/">Android架构组件(四)-LiveData</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        LiveData是一个可被观察的数据持有类。不同于常规的observable，LiveData是生命周期敏感的，也就意味着它尊重其他组件的生命周期，比如activities, fragments，或者services。这种特性确保了LiveData只会在一个激活的生命周期状态下更新应用组件下的observers。
如果观察者的生命周期处于STARTED或RESUMED状态，则LiveData...
    

        <a href="/2017/09/21/architecture-livedata/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android/">Android</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Architecture-Components/">Architecture Components</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/LiveData/">LiveData</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-architecture-lifecycle"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-15 15:14:25" datetime="2017-09-15T07:14:25.000Z"  itemprop="datePublished">2017-09-15</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/15/architecture-lifecycle/">Android架构组件(三)-生命周期</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        android.arch.lifecycle包提供了类和接口，使得你可以构建“生命周期敏感的组件”——自动适应当前Fragment或者Activity的组件。

注意：如何引入android.arch.lifecycle到你的安卓项目中，详见adding components to your project

安卓框架所定义的大多数组件都有相关的生命周期。生命周期被操作系统或运行在你程序中的...
    

        <a href="/2017/09/15/architecture-lifecycle/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android/">Android</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Architecture-Components/">Architecture Components</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Lifecycle/">Lifecycle</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-android-8-0-changes"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-15 11:02:23" datetime="2017-09-15T03:02:23.000Z"  itemprop="datePublished">2017-09-15</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/15/android-8-0-changes/">Android 8.0 行为变更</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        Android 8.0 除了提供诸多新特性和功能外，还对系统和 API 行为做出了各种变更。本文重点介绍您应该了解并在开发应用时加以考虑的一些主要变更。
其中大部分变更会影响所有应用，而不论应用针对的是何种版本的 Android。不过，有几项变更仅影响针对 Android 8.0 的应用。为清楚起见，本页面分为两个部分：针对所有 API 级别的应用和针对 Android 8.0 的应用。
针...
    

        <a href="/2017/09/15/android-8-0-changes/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android/">Android</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-8-0/">Android 8.0</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android-Developers/">Android Developers</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Oreo/">Oreo</a></li></ul>

    </div>
    
</article>

        </li>
    
        <li class="post-list-item fade">
            <article id="post-architecture-adding-components"
  class="article-card article-type-post" itemprop="blogPost">

    <div class="post-meta">
        <time class="post-time" title="2017-09-10 19:24:13" datetime="2017-09-10T11:24:13.000Z"  itemprop="datePublished">2017-09-10</time>

        


    </div>

    


  
    <h3 class="post-title" itemprop="name">
      <a class="post-title-link" href="/2017/09/10/architecture-adding-components/">Android架构组件(二)-添加组件</a>
    </h3>
  




    <div class="post-content" id="post-content" itemprop="postContent">

    
        架构组件发布在谷歌的Maven仓库，可以通过遵循以下步骤使用它们：
添加谷歌Maven仓库Android Studio项目默认没有配置对此仓库的访问。
为了添加其到你的项目中，打开项目根下的build.gradle文件(不是app或module目录下的)然后修改以下内容：123456allprojects &#123;    repositories &#123;        jcente...
    

        <a href="/2017/09/10/architecture-adding-components/" class="post-more waves-effect waves-button">
            阅读全文…
        </a>
    </div>
    
    <div class="post-footer">
        
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Android/">Android</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Architecture-Components/">Architecture Components</a></li></ul>

    </div>
    
</article>

        </li>
    
    </ul>

    
<nav id="page-nav">
    <div class="inner">
    <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="extend next" rel="next" href="/page/2/">下一页</a>
    </div>
</nav>


</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            
                <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            
            <span>博客内容遵循 <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">知识共享 署名 - 非商业性 - 相同方式共享 4.0 国际协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p><span>马建 &copy; 2015 - 2019</span>
            <span>
                
            </span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://yoursite.com/&title=随手记&pic=http://yoursite.com/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://yoursite.com/&title=随手记&source=desc" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://yoursite.com/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=随手记&url=http://yoursite.com/&via=http://yoursite.com" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://yoursite.com/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: false };


</script>

<script src="/js/main.min.js?v=1.7.2"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="/js/search.min.js?v=1.7.2" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>



<script>
(function() {
    var OriginTitile = document.title, titleTime;
    document.addEventListener('visibilitychange', function() {
        if (document.hidden) {
            document.title = '随手记';
            clearTimeout(titleTime);
        } else {
            document.title = '随手记';
            titleTime = setTimeout(function() {
                document.title = OriginTitile;
            },2000);
        }
    });
})();
</script>



</body>
</html>
